package com.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.service.MCommentService;
import com.service.MPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.ServletRequestUtils;

import javax.servlet.http.HttpServletRequest;

public class BaseController {
    @Autowired
    MPostService postService;
    @Autowired
    HttpServletRequest request;
    @Autowired
    MCommentService commentService;
    public Page getPage(){
        int pn = ServletRequestUtils.getIntParameter(request, "pn", 1);
        int size = ServletRequestUtils.getIntParameter(request, "size", 2);
        return new Page(pn,size);
    }
}
